From: Jonathan Lebon Date: Wed, 20 Sep 2017 17:07:54 +0000 (+0000) Subject: tests/libtest: check that we have setfattr X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~31^2~43 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22Program/%22http:/www.example.com/cgi/%22https:/%22Program?a=commitdiff_plain;h=95bfe6b8627d7184cc12db1772d537c575904583;p=ostree.git tests/libtest: check that we have setfattr We use `setfattr` to determine whether the filesystem we're on supports xattrs, but we need to check that `setfattr` itself is available. We just make it a hard requirement but only if trying to run tests that ask about xattr support. Closes: #1207 Approved by: cgwalters --- diff --git a/tests/libtest.sh b/tests/libtest.sh index 2b30e654..9bfc199f 100755 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -517,6 +517,9 @@ os_repository_new_commit () # Usage: if ! skip_one_without_user_xattrs; then ... more tests ...; fi _have_user_xattrs='' have_user_xattrs() { + if ! which setfattr 2>/dev/null; then + fatal "no setfattr available to determine xattr support" + fi if test "${_have_user_xattrs}" = ''; then touch test-xattrs if setfattr -n user.testvalue -v somevalue test-xattrs 2>/dev/null; then